package com.hmall.common.config;

import com.hmall.common.interceptor.FeignHeaderInterceptor;
import feign.RequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



@Configuration
public class FeignConfig {
    @Bean
    public RequestInterceptor requestInterceptor() {
        return new FeignHeaderInterceptor();
    }
        @Bean
        public RequestInterceptor requestIdInterceptor(){
            return template -> template
                    .header("x-request-from", "feign");//lmd写法，本质还是实现apply方法
        }
}
